#include <iostream>

using namespace std;

/**
 * 父类的指针指向子类的对象
 * 但是没有调用子类的函数，依然调用父类的函数
 **/
class Fruit
{
public:
    void peel()
    {cout << "peeling fruit" << endl;}
};

class Apple : public Fruit
{
public:
    void peel()
    {cout << "peeling apple" << endl;}
};

int main()
{
    Fruit *f;
    f = new Apple;
    f->peel();
    return 0;
}